import React, { Component } from 'react'
import styles from './Layout.module.css'
import { Link, Switch, Route, Redirect } from 'react-router-dom'
import Employee from './Employee'
import Salary from './Salary'

export default class Layout extends Component {
  render () {
    return (
      <div className={styles['layout-container']}>
        <div className={styles.left}>
          <p>
            <Link to='/layout/employee'>员工列表</Link>
          </p>
          <p>
            <Link to='/layout/salary'>工资列表</Link>
          </p>
        </div>
        <div className={styles.right}>
          <Switch>
            <Route path='/layout/employee' component={Employee} />
            <Route path='/layout/salary' component={Salary} />
            <Redirect exact from='/layout' to='/layout/employee' />
          </Switch>
        </div>
      </div>
    )
  }
}
